package  utils
{
	import flash.display.DisplayObject;
	/**
	 * ...
	 * @author FireKnight
	 */
	public final class CenterObjByNumber 
	{
		
		public function CenterObjByNumber() 
		{
			
		}
		
		public static function centerNumber(obj:DisplayObject,stageW:Number,stageH:Number):Array
		{
			
			
			var target_x:Number = (stageW - obj.width)>>1;
			var target_y:Number = (stageH - obj.height) >>1;
			return [target_x,target_y];
		}
		
		public static 	function centerObj(obj:DisplayObject,stageW:Number,stageH:Number):void
		{
			
			var target_x:Number;
			var target_y:Number;
			var arr:Array = centerNumber(obj, stageW,stageH);
			obj.x = arr[0];
			obj.y = arr[1];
		}
		
	}

}